<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
</head>
<body>
<a4j:form>
	<a4j:keepAlive beanName="perguntaBean"></a4j:keepAlive>
	<h:messages id="mensagens" globalOnly="true"></h:messages>
	<a4j:repeat id="perguntaList" value="#{perguntaBean.searchResults}"
		var="item">
		<li>
		<h2><h:outputText value="#{item.titulo}" /></h2>
		</li>

		<li>
		<div class="entry">
		<p><h:outputText id="content" value="#{item.descricao}" /></p>
		</div>
		</li>

		<li>
		<p class="postmetadata">Enviada em<h:outputText
			value=" #{item.dataEnvio}" /> |<br />
		<h:commandLink action="#{respostaBean.answer}"
			value="#{item.quantidadeRespostas} Resposta(s)">
			<f:setPropertyActionListener value="#{item.id}"
				target="#{respostaBean.idEntity}" />
		</h:commandLink> | <h:commandLink action="#{respostaBean.answer}" value="Responder">
			<f:setPropertyActionListener value="#{item.id}"
				target="#{respostaBean.idEntity}" />
		</h:commandLink> | <h:commandLink action="#{perguntaBean.blockQuestion}"
			value="Bloquear" rendered="#{authenticatorBean.admin}">
			<f:setPropertyActionListener value="#{item.id}"
				target="#{perguntaBean.idEntity}" />
		</h:commandLink></p>
		</li>
	</a4j:repeat>
	<rich:datascroller for="perguntaList" reRender="perguntaList" />
</a4j:form>
</body>
</html>